-- GENERATED SPELL FOR [Oluf the Violent] --


function spell0_23931(pUnit, Event) --@Cleave,n/a--
pUnit:FullCastSpellOnTarget(15284,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23931', 529, 1)
end

function spell1_23931(pUnit, Event) --@Demoralizing Shout,Self--
pUnit:FullCastSpellOnTarget(13730,pUnit)
pUnit:RegisterEvent('Sorts_23931', 30286, 1)
end

function spell2_23931(pUnit, Event) --@Drop Ancient Cipher,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(43326,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_23931', 1, 1)
end

function spell3_23931(pUnit, Event) --@Net,n/a--
pUnit:FullCastSpellOnTarget(6533,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23931', 2271, 1)
end

function spell4_23931(pUnit, Event) --@Throw Dragonflayer Harpoon,n/a--
pUnit:FullCastSpellOnTarget(42870,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23931', 850, 1)
end

function spell5_23931(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(41057,pUnit)
pUnit:RegisterEvent('Sorts_23931', 615, 1)
end

function spell6_23931(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(41056,pUnit)
pUnit:RegisterEvent('Sorts_23931', 2000, 1)
end

function Sorts_23931(pUnit, Event)
local choix_sorts_23931 = math.random(0, 6)
if choix_sorts_23931 == 0 then
pUnit:RegisterEvent('spell0_23931', 1, 1)
end
if choix_sorts_23931 == 1 then
pUnit:RegisterEvent('spell1_23931', 1, 1)
end
if choix_sorts_23931 == 2 then
pUnit:RegisterEvent('spell2_23931', 1, 1)
end
if choix_sorts_23931 == 3 then
pUnit:RegisterEvent('spell3_23931', 1, 1)
end
if choix_sorts_23931 == 4 then
pUnit:RegisterEvent('spell4_23931', 1, 1)
end
if choix_sorts_23931 == 5 then
pUnit:RegisterEvent('spell5_23931', 1, 1)
end
if choix_sorts_23931 == 6 then
pUnit:RegisterEvent('spell6_23931', 1, 1)
end
end

function mob23931_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23931', math.random(1500, 3000), 1)
end

function mob23931_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23931_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23931_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23931, 1, 'mob23931_Action')
RegisterUnitEvent(23931, 2, 'mob23931_Leave')
RegisterUnitEvent(23931, 3, 'mob23931_Kill')
RegisterUnitEvent(23931, 4, 'mob23931_Die')
